#include <iostream>
#include <string>
#include <unordered_map>
using namespace std;

bool isAnagram(string s, string t) 
{
	unordered_map<char, int> m;
	if (s.size() != t.size())
		return false;
	for (int i = 0; i < s.size(); i++)
	{
		m[s[i]]++;
	}
	for (int j = 0; j < t.size(); j++)
	{
		if (m[t[j]] <= 0)
		{
			return false;
		}
		m[t[j]]--;
	}
	return true;
}
int main()
{
	string s, t;
	while (1)
	{
		cin >> s >> t;
		if (isAnagram(s, t))
		{
			cout << "Yes" << endl;
		}
		else
		{
			cout << "No" << endl;
		}
	}
	return 0;
}